package com.gyl.web.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import com.gyl.utils.GenericSuperClass;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class BaseAction<T> extends ActionSupport implements ModelDriven<T>, ServletRequestAware, ServletResponseAware{
	
	//范类转换
	private Class entity = GenericSuperClass.getSuperClass(this.getClass()) ;
	
	//页面请求对象
	private HttpServletRequest request = null ;
	
	//页面响应对象
	private HttpServletResponse response = null ;
	
	//页面跳转字符串
	public final static String ADDUI = "addUI" ;
	public String addUI = ADDUI ;
	
	public final static String UPDATEUI = "updateUI" ;
	public String updateUI = UPDATEUI ;

	public final static String LISTACTION = "listAction" ;
	public String listAction = LISTACTION ;
	
	public final static String ACTION2ACTION = "action2action" ;
	public String action2action = ACTION2ACTION ;
	

	public T getModel() {
		return (T) entity;
	}

	public void setServletResponse(HttpServletResponse response) {
		this.response = response ;
	}

	public void setServletRequest(HttpServletRequest request) {
		this.request = request ;
	}

}
